<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\Picture;
class Shop extends Model
{
    protected $table = 'shop';

    protected $primarykey = 'id';

    public $timestamps = false;
    protected $appends = array('mobile_shop_logo');

    protected $fillable = ['shop_name','shop_logo','shop_desc','sort_order','is_show'];

    function getMobileShopLogoAttribute(){

        $shop_logo = $this->getAttribute('shop_logo');

        if(!$shop_logo){
            return null;
        }
        return Picture::find($shop_logo)->url;


    }
}
